#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Version: Python 2.6.6
# Author: Sergey K.
# Created: 2011-11-04


def dummy(bases=object,):
    class dummy(bases):
        def __init__(self):
            super(dummy, self).__init__()
    return dummy()

def cache(control=None,tag=None):
    from rs.cache import CacheManager
    class cache(object):
        __getitem__ = lambda self, x: CacheManager.CacheEntry(control, tag)
    return cache()

def server(cache=cache(), dummy_bases=object,):
    server = dummy(dummy_bases)
    server.get_instance = lambda cls: None
    server.cache = cache
    return server

def params():
    from rs.core import rs_dict
    params = rs_dict()
    params.path = {}
    params.query = {}
    params.form = {}
    return params

def request():
    request = dummy()
    request.uri = dummy()
    request.uri.query = ''
    request.headers = {}
    return request